package net.system.sys.dao.impl;

import java.util.List;
import net.system.base.bean.SSysuser;
import net.system.base.bean.SSysuserExample;
import net.system.sys.dao.SSysuserDAO;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class SSysuserDAOImpl extends SqlMapClientDaoSupport implements SSysuserDAO {

    public SSysuserDAOImpl() {
        super();
    }

    public void insert(SSysuser record) {
        getSqlMapClientTemplate().insert("s_sysuser.abatorgenerated_insert", record);
    }

    public int updateByPrimaryKey(SSysuser record) {
        int rows = getSqlMapClientTemplate().update("s_sysuser.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    public int updateByPrimaryKeySelective(SSysuser record) {
        int rows = getSqlMapClientTemplate().update("s_sysuser.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    public List selectByExample(SSysuserExample example) {
        List list = getSqlMapClientTemplate().queryForList("s_sysuser.abatorgenerated_selectByExample", example);
        return list;
    }

    public SSysuser selectByPrimaryKey(String recId) {
        SSysuser key = new SSysuser();
        key.setRecId(recId);
        SSysuser record = (SSysuser) getSqlMapClientTemplate().queryForObject("s_sysuser.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    public int deleteByExample(SSysuserExample example) {
        int rows = getSqlMapClientTemplate().delete("s_sysuser.abatorgenerated_deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(String recId) {
        SSysuser key = new SSysuser();
        key.setRecId(recId);
        int rows = getSqlMapClientTemplate().delete("s_sysuser.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    public int countByExample(SSysuserExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("s_sysuser.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    public int updateByExampleSelective(SSysuser record, SSysuserExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("s_sysuser.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(SSysuser record, SSysuserExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("s_sysuser.abatorgenerated_updateByExample", parms);
        return rows;
    }

    private static class UpdateByExampleParms extends SSysuserExample {
        private Object record;

        public UpdateByExampleParms(Object record, SSysuserExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}